package com.example.sam.widgettest414_fzh;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class NewActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new);
        Intent intent = getIntent();
        String str=intent.getStringExtra("param1");
        int n=intent.getIntExtra("param2",10);
        System.out.print("....."+str+"....."+String.valueOf(n));
        Toast.makeText(this,str+"....."+String.valueOf(n),Toast.LENGTH_LONG);
        TextView tv=(TextView)findViewById(R.id.textView3);
        tv.setText(str+".."+String.valueOf(n));

        Button button=(Button)findViewById(R.id.button);
        button.setOnClickListener(this);
    }
    @Override
    public void onClick(View view){
   switch(view.getId())
   {
       case R.id.button:
           finish();
           break;
   }
    }
}
